package com.shop.entity;

import java.io.Serializable;
import java.util.Objects;

//购物车详情表
public class ShopcartDetail implements Serializable {
    private int sd_id;              //购物车详情id
    private int sc_id;             //购物车id(购物车表外键)
    private int gd_id;             //商品详情表id(外键)
    private int sd_num;             //购物车详情表商品数量
    private int sd_state;             //选中状态（0未选中，1已选中)

    public ShopcartDetail() {
    }

    public ShopcartDetail(int sd_id, int sc_id, int gd_id, int sd_num, int sd_state) {
        this.sd_id = sd_id;
        this.sc_id = sc_id;
        this.gd_id = gd_id;
        this.sd_num = sd_num;
        this.sd_state = sd_state;
    }

    public int getSd_id() {
        return sd_id;
    }

    public void setSd_id(int sd_id) {
        this.sd_id = sd_id;
    }

    public int getSc_id() {
        return sc_id;
    }

    public void setSc_id(int sc_id) {
        this.sc_id = sc_id;
    }

    public int getGd_id() {
        return gd_id;
    }

    public void setGd_id(int gd_id) {
        this.gd_id = gd_id;
    }

    public int getSd_num() {
        return sd_num;
    }

    public void setSd_num(int sd_num) {
        this.sd_num = sd_num;
    }

    public int getSd_state() {
        return sd_state;
    }

    public void setSd_state(int sd_state) {
        this.sd_state = sd_state;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ShopcartDetail that = (ShopcartDetail) o;
        return sd_id == that.sd_id &&
                sc_id == that.sc_id &&
                gd_id == that.gd_id &&
                sd_num == that.sd_num &&
                sd_state == that.sd_state;
    }

    @Override
    public int hashCode() {
        return Objects.hash(sd_id, sc_id, gd_id, sd_num, sd_state);
    }

    @Override
    public String toString() {
        return "ShopcartDetail{" +
                "sd_id=" + sd_id +
                ", sc_id=" + sc_id +
                ", gd_id=" + gd_id +
                ", sd_num=" + sd_num +
                ", sd_state=" + sd_state +
                '}';
    }
}
